package com.hlf.modules.api.quartz;

import com.hlf.common.constants.Constants;
import com.hlf.modules.merchant.store.entity.Store;
import com.hlf.modules.merchant.store.entity.XdLInfo;
import com.hlf.modules.merchant.store.service.StoreService;
import com.hlf.modules.merchant.store.service.XdLInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * Created by Administrator on 2017/12/21.
 */
@Component
public class SpdQuartz {

    @Autowired
    private StoreService storeService;
    @Autowired
    private XdLInfoService xdLInfoService;


    /**
     * 每天更新正在审核
     */
    public void dailyUpdate(){
        List<Store> storeList = storeService.queryListByReview(Constants.AUDIT_STATUS_REVIEW);
        for (Store store : storeList) {
            XdLInfo xdLInfo = xdLInfoService.selectByPrimaryKey(store.getId());
            xdLInfoService.merchantSubmit(xdLInfo);
        }
    }



}
